package wordsort.test;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

public class WSReducer extends Reducer<IntWritable, IntWritable, IntWritable, IntWritable> {
    IntWritable word = new IntWritable();
    IntWritable seq = new IntWritable(1);
    @Override
    protected void reduce(IntWritable key, Iterable<IntWritable> values, Context context) throws IOException, InterruptedException {
        for (IntWritable x:values) {
            //reducer output: key,num
            context.write(key, new IntWritable(x.get()));
        }
    }
}
